package com.team10.hotel.service.impl;

import com.team10.hotel.domain.City;
import com.team10.hotel.mapper.CityMapper;
import com.team10.hotel.service.CityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CityServiceImpl implements CityService {

    @Autowired
    private CityMapper cityMapper;

    @Override
    public List<City> findAllCityAndProvinceName() {
        return cityMapper.selectAllCityAndProvinceName();
    }

    @Override
    public List<City> findAllByProvinceId(Integer provinceId) {
        return cityMapper.selectByProvinceId(provinceId);
    }

    @Override
    public int findProvinceId(Integer cityId) {
        return cityMapper.selectProvinceId(cityId);
    }

    @Override
    public City findTotalNameByPrimaryKey(Integer cityId) {
        return cityMapper.selectTotalNameByPrimaryKey(cityId);
    }

//    @Override
//    public List<City> findHotCity(Integer amount) {
//        return cityMapper.selectHotCity(amount);
//    }
}
